using PetShop.BusinessEntities;
using PetShop.DataAccess.DAO;

namespace PetShop.BusinessEntityManagers
{
    public class AccountBO
    {
        public AccountInfo SignIn(string userId, string password)
        {
            if ((userId.Trim() == string.Empty) || (password.Trim() == string.Empty))
                return null;


            var dal = new AccountDAO();


            AccountInfo account = dal.GetAccountInfo(userId, password);


            return account;
        }


        public void Insert(AccountInfo account)
        {
            if (account.UserId.Trim() == string.Empty)
                return;
            var dal = new AccountDAO();
            dal.Insert(account);
        }

        public void Update(AccountInfo account)
        {
            if (account.UserId.Trim() == string.Empty)
                return;
            var dal = new AccountDAO();
            dal.Update(account);
        }
    }
}